﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Xiao.Util
{
    public class StringUtil
    {

        /// <summary>
        /// 获取字符串数字随机
        /// </summary>
        /// <param name="n"></param>
        /// <returns></returns>
        public static string GetString(int n)
        {
            string str = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
            StringBuilder sb = new();
            var rd = new Random();
            for (int i = 0; i < n; i++) sb.Append(str.Substring(rd.Next(0, str.Length), 1));
            return sb.ToString();
        }
    }
}
